import React, { PureComponent } from 'react'
import { Link, Outlet } from 'react-router-dom'
import { withRouter } from '../hoc'

export class Home extends PureComponent {
  render() {
    return (
      <div>
        <div className="nav">
          <Link to="/home/recommend">推荐</Link>
          <Link to="/home/ranking">排行榜</Link>
          <button onClick={(e) => this.navigateTo('/home/songMenu')}>
            歌单
          </button>
        </div>
        {/* 站位组价 */}
        <Outlet />
        <h1>Home Page</h1>
      </div>
    )
  }

  navigateTo(path) {
    console.log(this.props.router)
    const { navigate } = this.props.router
    navigate(path)
  }
}

export default withRouter(Home)
